package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vo.user.Publisher;
import org.apache.ibatis.annotations.*;

/**
 * @author LeXin Huang
 * @date 2021年03月30日 19:37
 */
@Mapper
public interface PublisherMapper extends BaseMapper<Publisher> {
    String USER_ID = "id";

    @Results(id = "publisherMap", value = {
            @Result(column = "id", property = "userId", javaType = Integer.class, id = true),
            @Result(column = "user_portrait_path", property = "userPortraitPath", javaType = String.class),
            @Result(column = "user_username", property = "username", javaType = String.class)
    })
    @Select("Select * from user where id = #{userId}")
    Publisher selectBy1Id(@Param("userId") Integer userId);
}